using System;

namespace NWrapper.Attributes
{
	/// <summary>
	/// Use this attribute to specify a given class as an entity object to be consumed
	/// by a repository with a given name. Useful for identifying different classes
	/// with different repositories.
	/// </summary>
	[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
	public sealed class EntityAttribute : Attribute
	{
		private string _name;

		/// <summary>
		/// Sets the name of the repository this entity class should belong to.
		/// </summary>
		/// <param name="name"></param>
		public EntityAttribute(string name)
		{
			_name = name;
		}

		/// <summary>
		/// Gets the name of this entity's repository.
		/// </summary>
		public string Name
		{
			get { return _name; }
		}
	}
}
